const { defineConfig } = require('@vue/cli-service')
const px2rem = require('postcss-px2rem')
module.exports = defineConfig({
  transpileDependencies: true,
  publicPath:'./',
  outputDir:'client',
  css: {
    loaderOptions: {
      postcss: {
        postcssOptions: {
          processors: [
            px2rem({remUnit: 10}) // 基准大小 baseSize，需要和rem.js中相同
          ]
        },
      }
    }
  },
  devServer:{
    // headers:{
    //   'cookie': 'gr_user_id=13cfae59-8bcd-432a-b9da-e836047df292; token=; token.sig=zqgCfwFPm7OzF5QIkFNPtLU-06A; wzj_visitor=c3635820-ee59-46f2-b7e6-fd79a904cea1; wzj_visitor.sig=5O328qcEhFUtvVPuXDcnX24TARI; app_city=%7B%22id%22%3A27%2C%22pinyin%22%3A%22HANGZHOUSHI%22%2C%22name%22%3A%22%E6%9D%AD%E5%B7%9E%E5%B8%82%22%2C%22province_id%22%3A7%2C%22app_city%22%3A1%2C%22app_city_sort%22%3A9%2C%22code%22%3A%22330100%22%2C%22initial%22%3A%22H%22%2C%22hot_sort%22%3A5%7D; app_city.sig=pfkijJ_L0PS_7ndDwzjB3_GDOUg; has_webp_support=true; __snaker__id=l2SdpzY3AHx7hNBK; gdxidpyhxdE=jrCoM9aij4uxRBOmY1IU%2BfI%2FQ9Nkekf6Xuke4UboyHldg%2B3Lk3K9C%5COVG7geORG9vxHv9XRdvffb3SRpATUQH%2FAhPiIux%2BEGx6op%2FtT1lE1rBQe5865V72nUNpxmv4WaGpK%2FXLCERei8tsff5JGb7Yjk3a%5C7fBaXZKhIMHjvcj%5CPDMK8%3A1656503202383; _9755xjdesxxd_=32; WZJ_H5NewUserEnter=true; YD00107995810142%3AWM_NI=EuAIX%2FRErsqz1YcklxrWkBEKrPMMjJAtiFwZs3RBhjJD5vn7k7tdvrLT7Zx%2FMdWgUqb8JZt7pneOHOWNvQ%2Fm83Oi8DL5TsX%2F1seTkbT2OaL%2Bks9jDKrug9LYv5iFfYAOeWQ%3D; YD00107995810142%3AWM_NIKE=9ca17ae2e6ffcda170e2e6ee92ef4df4e7aaacf44ae9968ab3d54e968a9e86d85afbb2faa4f365ace881a7c72af0fea7c3b92a87ab8faadb25929bbe94f472f387ad8cef74b289a5a3c841b29083aee94283aca7a7f652b1ed9ea3eb628a9cfb97ed3da9e9bc85f57a908cf9bbfb258fbc9988d87ba2e886bbf73db4b2abb0cb459592bab2ae67fced818abb5090eb9c94db25f3adabb5ea6a98ee8182cf21a9adf78bc741b2aba9dacf53b6eba7a7e5538391abb8d437e2a3; YD00107995810142%3AWM_TID=3f5VhJg%2FhWNBAUBUAReBV4i%2FCotxoeVW; Hm_lvt_47747dbb101506f87649a01472b95be4=1656502295,1656668456; Hm_lpvt_47747dbb101506f87649a01472b95be4=1656668456; a49dd7c1dcde2072_gr_session_id=e9950cae-cca6-4619-9476-4c7b8753655a; a49dd7c1dcde2072_gr_session_id_e9950cae-cca6-4619-9476-4c7b8753655a=true; gr_session_id_a49dd7c1dcde2072=a272684a-e11c-420d-9d18-4102d50b84f7; gr_session_id_a49dd7c1dcde2072_a272684a-e11c-420d-9d18-4102d50b84f7=true; has_location_merchant_store=%5Bobject%20Object%5D',
    //   'referer': 'https://m.wzj.com/items/12234?sku_id=39734',
    //   'x-bdbs-device-id': 'c3635820-ee59-46f2-b7e6-fd79a904cea1'
    // },
    proxy:{
      '/hehe':{
        target:'https://shopapi.smartisan.com',
        pathRewrite:{  //剔除代理路径
          '^/hehe':''
        }
        // 不剔除
        // https://shopapi.smartisan.com/hehe/product/home
        // 剔除后
        // https://shopapi.smartisan.com/product/home
      },
      '/wzj':{
        target:'https://m.wzj.com',
        pathRewrite:{ //剔除代理路径
          '^/wzj':''
        },
        changeOrigin:true
      }
    }
  }
})
